#pragma once

#include "Vector3.h"
#include "Matrix4.h"

namespace soft_renderer
{
	class Camera
	{
	private:
		Vector3 position; // 位置
		Vector3 up; // 向上的方位，单位向量
		Vector3 target; // 看向的对象位置
		Matrix4 _viewMatrix; // 观察矩阵

	protected:
		Matrix4 _projectionMatrix; // 投影矩阵

	public:
		Camera();
		virtual void updateProjectionMatrix() = 0;
		void updateViewMatrix();
		void setPosition(Vector3 position);
		void setTarget(Vector3 target);
		void setUp(Vector3 up);
		const Matrix4& viewMatrix() const;
		const Matrix4& projectionMatrix() const;
	};
}